import request from '@/utils/request'
import { limit } from '@/consts/consts'
const devUrl = 'dev'

export default {
  // 4.8.2．告警处理
  alarmProcess(data) {
    return request({
      url: `${devUrl}/api/v1/devices/alarm/process`,
      method: 'post',
      data: { 
        data 
      }
    })
  },

  // 4.11  查询告警列表
  alarmList(queryData, data) {
    return request({
      url: `${devUrl}/api/v1/devices/alarm/list`,
      method: 'post',
      params: queryData,
      data: { 
        data 
      }
    })
  },

  // 4.11.2．查询告警详情
  alarmDetail(alarm_id) {
    return request({
      url: `${devUrl}/api/v1/devices/alarm/detail/${alarm_id}`,
      method: 'get',
    })
  },

  // 4.11.4．导出告警列表
  alarmExport(data) {
    return dowloadService({
      url: `${devUrl}/api/v1/devices/alarm/export`,
      method: 'post',
      data: {
        data
      }
    })
  },

  // 4.12.8、按项目设备类型分组查询设备类型告警总数
  alarmDeviceTypeTotal(params) {
    return request({
      url: `${devUrl}/api/v1/devices/alarm_device_type/total`,
      method: 'GET',
      params
    })
  },
  
  // 4.12.9、按告警等级查询告警总数
  alarmLevelTotal(params) {
    return request({
      url: `${devUrl}/api/v1/devices/alarm_level/total`,
      method: 'GET',
      params
    })
  }
}
